home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!usenet
- From: Liang Lu <llu>
- Newsgroups: comp.lang.c++
- Subject: How to initialize array of objects using non-void constructor?
- Date: 27 Mar 1996 17:43:33 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <4jbuo5$mcb@newshost.lanl.gov>
- NNTP-Posting-Host: oyt.lanl.gov
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4c)
- X-URL: news:comp.lang.c++
-
- Example:
-
- class Table {
- Table() ;
- Table(int n) ;
- ..
- } ;
-
- Table object[10] ; // default constructor are used here
-
- But, How can I have 10 objects each with different n, i.e., how to use the
- second constructor for array initialization? Please email me the answer.
-
- --
- Best Regards,
-
-
-
- Liang
-
- Liang Lu
- CNLS/T13
- MS B213
- Los Alamos National Laboratory
- Los Alamos, NM 87545
-
- Tele: 505-665-7537
- Fax: 505-665-3003
- Email: llu@t13.lanl.gov
- On-line Home-page: http://t13.lanl.gov/~llu/
-
- Direction to my office: Off Diamond Dr., turn left or right on Eniwetok Dr.,
- turn immediate left into a parking lot, my trailer is the only trailer at the
- end of the parking lot, TA-3 SM-1543.
-
-